import * as chars from './chars'
import { Coord } from './coord';

export class Princess {
  static readonly heartHealth = 10;

  pos = new Coord();
  treasures = 0;

  constructor(public health = 10) { }

  visit(char: string) {
    switch (char) {
      case chars.heart:
        this.health = Princess.heartHealth;
        break;
      case chars.monster:
        this.treasures = 0
        break;
      case chars.key:
      // fall-through
      case chars.treasure:
        this.treasures++;
        this.health--;
        break;
      default:
        this.health--;
        break;
    }
  }
}
